using Spine;
using Spine.Unity;
using UnityEngine;

namespace PKGames
{
	public class SpineEventHandler : MonoBehaviour
	{
		protected SkeletonAnimation _skeletonAnimation;

		protected MeshRenderer _meshRenderer;

		protected void Start()
		{
			_meshRenderer = base.gameObject.GetComponent<MeshRenderer>();
			_skeletonAnimation = base.gameObject.GetComponent<SkeletonAnimation>();
			_skeletonAnimation.state.Event += EventHandler;
		}

		protected void OnDestroy()
		{
			if (_skeletonAnimation != null)
			{
				_skeletonAnimation.state.Event -= EventHandler;
			}
		}

		protected virtual void EventHandler(TrackEntry track, Spine.Event e)
		{
		}
	}
}
